<?php

include 'Zend/Db.php';  

$dbConfig = array(
    'host'      => 'localhost',
    'username'  => 'root',
    'password'  => '',
    'dbname'    => 'markr'
);

$db = Zend_Db::factory('Pdo_Mysql', $dbConfig);

extract($_POST);

$review_record = array(
	'review_id'		=> '',
	'entry_id'		=> $entry_id,
	'review'		=> $review,
	'flagged'		=> $flagged,
	'reviewed'		=> $reviewed,
	'fk_entry_id'	=> 0
);

// query if record 
//echo "$from_db";
$review_id = (int)$review_id;
if ($review_id > 0) {
	$review_record['review_id'] = $review_id;
	$db->update('reviews', $review_record, "review_id = $review_id");
	print_r($review_record);
}
else {
	$db->insert('reviews', $review_record);
}

?>